<?
require_once 'config.php';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="vi" lang="vi" xmlns:og="http://ogp.me/ns#" xmlns:fb="http://www.facebook.com/2008/fbml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="language" content="vietnamese" />
    <meta name="ROBOTS" content="INDEX, FOLLOW" />
    <meta name="AUTHOR" content="Sudo" />
    <meta name="COPYRIGHT" content="Copyright (C) 2013 Sudo.vn" />
    <link href="http://sudo.vn/favicon.ico" type="image/x-icon" rel="shortcut icon"/>
	<title>Kiểm tra tên miền - check domain</title>
	<meta content="Tra cứu tên miền trực tuyến nhanh và đơn giản nhất" name="description"/>
    <!-- css -->
    <link rel="stylesheet" type="text/css" href="../themes/css/base.css" />
    <link rel="stylesheet" type="text/css" href="../themes/css/detail.css" />	
    <link rel="stylesheet" type="text/css" href="../themes/css/check_domain.css" />	
    <!-- js -->
	<script type="text/javascript" src="../themes/js/jquery-1.9.0.min.js"></script>
	<script type="text/javascript" src="../themes/js/detail_style.js"></script>
	<script type="text/javascript" src="../themes/js/common.js"></script>
	<script type="text/javascript" src="../themes/js/jquery.slimscroll.min.js"></script>
    <?=$google_analytics?>
</head>
<body>
<? include('../view/view_common_loader.php')?>
<div class="wrapper">
    <div class="mg_left">
    
    </div><!-- End mg_left -->
    <div class="detail">
    <div class="scroll_dt">
        <div class="logo">
            <a href="<?=DOMAIN?>">
                <p class="h1">Sudo</p>
                <p class="h3">Web Solutions</p>
            </a>
        </div>
        <div class="content" style="padding: 0px 10px;">
            <div class="check_domain_title">
                <h1>Kiểm tra tên miền</h1>
            </div>
            <div class="check_domain_content">
                <div class="check_domain_action">
                    <div class="check_domain_step check_domain_step1">
                        <div class="title">
                            <h2><span>1</span> Nhập tên miền cần kiểm tra</h2>
                        </div>
                        <div class="main">
                            <input type="text" name="domain" class="domain_input" placeholder="Tên miền ..." />
                        </div>
                    </div>
                    <div class="check_domain_step check_domain_step2">
                        <div class="title">
                            <h2><span>2</span> Chọn loại tên miền kiểm tra</h2>
                        </div>
                        <div class="main">
                            <div class="list_check_tab">
                                <div class="list_check_tab_phobien active">
                                    Phổ biến
                                </div>
                                <div class="list_check_tab_vietnam">
                                    Việt Nam
                                </div>
                                <div class="list_check_tab_quocte">
                                    Quốc tế
                                </div>
                                <div class="list_check_tab_diagioi">
                                    Địa giới hành chính
                                </div>
                            </div>
                            <ul class="list_check list_check_phobien" style="display: block;">
                            	<li><input type="checkbox" name="ext" value=".vn" checked="checked"/> .vn</li>
                                <li><input type="checkbox" name="ext" value=".com" checked="checked"/> .com</li>
                                <li><input type="checkbox" name="ext" value=".com.vn" checked="checked"/> .com.vn</li>
                                <li><input type="checkbox" name="ext" value=".net" checked="checked"/> .net</li>
                                <li><input type="checkbox" name="ext" value=".net.vn" checked="checked"/> .net.vn</li>
                                <li><input type="checkbox" name="ext" value=".org" checked="checked"/> .org</li>
                                <li><input type="checkbox" name="ext" value=".info" checked="checked"/> .info</li>
                                <div class="clr"></div>
                            </ul>
                            <ul class="list_check list_check_vietnam">
                            	<li><input type="checkbox" name="ext" value=".vn"/> .vn</li>
                                <li><input type="checkbox" name="ext" value=".com.vn"/> .com.vn</li>
                                <li><input type="checkbox" name="ext" value=".net.vn"/> .net.vn</li>
                                <li><input type="checkbox" name="ext" value=".edu.vn"/> .edu.vn</li>
                                <li><input type="checkbox" name="ext" value=".org.vn" /> .org.vn</li>
                                <li><input type="checkbox" name="ext" value=".info.vn" /> .info.vn</li>
                                <li><input type="checkbox" name="ext" value=".gov.vn" /> .gov.vn</li>
                                <li><input type="checkbox" name="ext" value=".edu.vn" /> .edu.vn</li>
                                <li><input type="checkbox" name="ext" value=".biz.vn" /> .biz.vn</li>
                                <li><input type="checkbox" name="ext" value=".name.vn" /> .name.vn</li>
                                <li><input type="checkbox" name="ext" value=".pro.vn" /> .pro.vn</li>
                                <li><input type="checkbox" name="ext" value=".health.vn" /> .health.vn</li>
                                <li><input type="checkbox" name="ext" value=".int.vn" /> .int.vn</li>
                                <li><input type="checkbox" name="ext" value=".ac.vn" /> .ac.vn</li>
                                <div class="clr"></div>
                            </ul>
                            <ul class="list_check list_check_quocte">
                                <li><input type="checkbox" name="ext" value=".com"/> .com</li>
                                <li><input type="checkbox" name="ext" value=".net"/> .net</li>
                                <li><input type="checkbox" name="ext" value=".org"/> .org</li>
                                <li><input type="checkbox" name="ext" value=".info"/> .info</li>
                                <li><input type="checkbox" name="ext" value=".us" /> .us</li>
                                <li><input type="checkbox" name="ext" value=".biz" /> .biz</li>
                                <li><input type="checkbox" name="ext" value=".cc" /> .cc</li>
                                <li><input type="checkbox" name="ext" value=".asia" /> .asia</li>
                                <li><input type="checkbox" name="ext" value=".eu" /> .eu</li>
                                <li><input type="checkbox" name="ext" value=".me" /> .me</li>
                                <li><input type="checkbox" name="ext" value=".tel" /> .tel</li>
                                <li><input type="checkbox" name="ext" value=".ws" /> .ws</li>
                                <li><input type="checkbox" name="ext" value=".name" /> .name</li>
                                <li><input type="checkbox" name="ext" value=".tv" /> .tv</li>
                                <li><input type="checkbox" name="ext" value=".mobi" /> .mobi</li>
                                <li><input type="checkbox" name="ext" value=".bz" /> .bz</li>
                                <li><input type="checkbox" name="ext" value=".mn" /> .mn</li>
                                <li><input type="checkbox" name="ext" value=".in" /> .in</li>
                                <li><input type="checkbox" name="ext" value=".co.uk" /> .co.uk</li>
                                <li><input type="checkbox" name="ext" value=".es" /> .es</li>
                                <li><input type="checkbox" name="ext" value=".de" /> .de</li>
                                <li><input type="checkbox" name="ext" value=".xxx" /> .xxx</li>
                                <li><input type="checkbox" name="ext" value=".com.ru" /> .com.ru</li>
                                <li><input type="checkbox" name="ext" value=".pro" /> .pro</li>
                                <li><input type="checkbox" name="ext" value=".pw" /> .pw</li>
                                <li><input type="checkbox" name="ext" value=".nl" /> .nl</li>
                                <li><input type="checkbox" name="ext" value=".in.net" /> .in.net</li>
                                <div class="clr"></div>
                            </ul>
                            <ul class="list_check list_check_diagioi">
                                <li><input type="checkbox" name="ext" value=".angiang.vn"/>angiang.vn</li>
                                <li><input type="checkbox" name="ext" value=".bacgiang.vn"/>bacgiang.vn</li>
                                <li><input type="checkbox" name="ext" value=".backan.vn"/>backan.vn</li>
                                <li><input type="checkbox" name="ext" value=".baclieu.vn"/>baclieu.vn</li>
                                <li><input type="checkbox" name="ext" value=".bacninh.vn"/>bacninh.vn</li>
                                <li><input type="checkbox" name="ext" value=".baria-vungtau.vn"/>baria-vungtau.vn</li>
                                <li><input type="checkbox" name="ext" value=".bentre.vn"/>bentre.vn</li>
                                <li><input type="checkbox" name="ext" value=".binhdinh.vn"/>binhdinh.vn</li>
                                <li><input type="checkbox" name="ext" value=".binhduong.vn"/>binhduong.vn</li>
                                <li><input type="checkbox" name="ext" value=".binhphuoc.vn"/>binhphuoc.vn</li>
                                <li><input type="checkbox" name="ext" value=".binhthuan.vn"/>binhthuan.vn</li>
                                <li><input type="checkbox" name="ext" value=".camau.vn"/>camau.vn</li>
                                <li><input type="checkbox" name="ext" value=".cantho.vn"/>cantho.vn</li>
                                <li><input type="checkbox" name="ext" value=".caobang.vn"/>caobang.vn</li>
                                <li><input type="checkbox" name="ext" value=".daklak.vn"/>daklak.vn</li>
                                <li><input type="checkbox" name="ext" value=".daknong.vn"/>daknong.vn</li>
                                <li><input type="checkbox" name="ext" value=".danang.vn"/>danang.vn</li>
                                <li><input type="checkbox" name="ext" value=".dienbien.vn"/>dienbien.vn</li>
                                <li><input type="checkbox" name="ext" value=".dongnai.vn"/>dongnai.vn</li>
                                <li><input type="checkbox" name="ext" value=".dongthap.vn"/>dongthap.vn</li>
                                <li><input type="checkbox" name="ext" value=".gialai.vn"/>gialai.vn</li>
                                <li><input type="checkbox" name="ext" value=".hagiang.vn"/>hagiang.vn</li>
                                <li><input type="checkbox" name="ext" value=".haiduong.vn"/>haiduong.vn</li>
                                <li><input type="checkbox" name="ext" value=".haiphong.vn"/>haiphong.vn</li>
                                <li><input type="checkbox" name="ext" value=".hanam.vn"/>hanam.vn</li>
                                <li><input type="checkbox" name="ext" value=".hanoi.vn"/>hanoi.vn</li>
                                <li><input type="checkbox" name="ext" value=".hatinh.vn"/>hatinh.vn</li>
                                <li><input type="checkbox" name="ext" value=".haugiang.vn"/>haugiang.vn</li>
                                <li><input type="checkbox" name="ext" value=".hoabinh.vn"/>hoabinh.vn</li>
                                <li><input type="checkbox" name="ext" value=".hungyen.vn"/>hungyen.vn</li>
                                <li><input type="checkbox" name="ext" value=".khanhhoa.vn"/>khanhhoa.vn</li>
                                <li><input type="checkbox" name="ext" value=".kiengiang.vn"/>kiengiang.vn</li>
                                <li><input type="checkbox" name="ext" value=".kontum.vn"/>kontum.vn</li>
                                <li><input type="checkbox" name="ext" value=".laichau.vn"/>laichau.vn</li>
                                <li><input type="checkbox" name="ext" value=".lamdong.vn"/>lamdong.vn</li>
                                <li><input type="checkbox" name="ext" value=".langson.vn"/>langson.vn</li>
                                <li><input type="checkbox" name="ext" value=".laocai.vn"/>laocai.vn</li>
                                <li><input type="checkbox" name="ext" value=".longan.vn"/>longan.vn</li>
                                <li><input type="checkbox" name="ext" value=".namdinh.vn"/>namdinh.vn</li>
                                <li><input type="checkbox" name="ext" value=".name"/>name</li>
                                <li><input type="checkbox" name="ext" value=".name.vn"/>name.vn</li>
                                <li><input type="checkbox" name="ext" value=".net"/>net</li>
                                <li><input type="checkbox" name="ext" value=".net.co"/>net.co</li>
                                <li><input type="checkbox" name="ext" value=".net.tw"/>net.tw</li>
                                <li><input type="checkbox" name="ext" value=".net.vn"/>net.vn</li>
                                <li><input type="checkbox" name="ext" value=".nghean.vn"/>nghean.vn</li>
                                <li><input type="checkbox" name="ext" value=".ninhbinh.vn"/>ninhbinh.vn</li>
                                <li><input type="checkbox" name="ext" value=".ninhthuan.vn"/>ninhthuan.vn</li>
                                <li><input type="checkbox" name="ext" value=".phutho.vn"/>phutho.vn</li>
                                <li><input type="checkbox" name="ext" value=".phuyen.vn"/>phuyen.vn</li>
                                <li><input type="checkbox" name="ext" value=".pro.vn"/>pro.vn</li>
                                <li><input type="checkbox" name="ext" value=".quangbinh.vn"/>quangbinh.vn</li>
                                <li><input type="checkbox" name="ext" value=".quangnam.vn"/>quangnam.vn</li>
                                <li><input type="checkbox" name="ext" value=".quangngai.vn"/>quangngai.vn</li>
                                <li><input type="checkbox" name="ext" value=".quangninh.vn"/>quangninh.vn</li>
                                <li><input type="checkbox" name="ext" value=".quangtri.vn"/>quangtri.vn</li>
                                <li><input type="checkbox" name="ext" value=".soctrang.vn"/>soctrang.vn</li>
                                <li><input type="checkbox" name="ext" value=".sonla.vn"/>sonla.vn</li>
                                <li><input type="checkbox" name="ext" value=".tayninh.vn"/>tayninh.vn</li>
                                <li><input type="checkbox" name="ext" value=".thaibinh.vn"/>thaibinh.vn</li>
                                <li><input type="checkbox" name="ext" value=".thainguyen.vn"/>thainguyen.vn</li>
                                <li><input type="checkbox" name="ext" value=".thanhhoa.vn"/>thanhhoa.vn</li>
                                <li><input type="checkbox" name="ext" value=".thanhphohochiminh.vn"/>thanhphohochiminh.vn</li>
                                <li><input type="checkbox" name="ext" value=".thuathienhue.vn"/>thuathienhue.vn</li>
                                <li><input type="checkbox" name="ext" value=".tiengiang.vn"/>tiengiang.vn</li>
                                <li><input type="checkbox" name="ext" value=".travinh.vn"/>travinh.vn</li>
                                <li><input type="checkbox" name="ext" value=".tuyenquang.vn"/>tuyenquang.vn</li>
                                <li><input type="checkbox" name="ext" value=".vinhlong.vn"/>vinhlong.vn</li>
                                <li><input type="checkbox" name="ext" value=".vinhphuc.vn"/>vinhphuc.vn</li>
                                <li><input type="checkbox" name="ext" value=".yenbai.vn"/>yenbai.vn</li>
                                <div class="clr"></div>
                            </ul>
                        </div>
                    </div>
                    <div class="check_domain_step check_domain_step3">
                        <div class="title">
                            <h2><span>3</span> Click kiểm tra</h2>
                        </div>
                        <div class="main">
                            <input type="submit" name="submit_domain" class="domain_submit" value="Kiểm tra" />
                        </div>
                        <div class="style_load_img" style="display: none;">
                            <ul class="">
                                <li class="domain_loading">&nbsp;</li>
                                <li class="domain_registed"><p>&nbsp;</p></li>
                                <li class="domain_active"><p>&nbsp;</p></li>
                            </ul>
                        </div>
                    </div>
                </div>
                <div class="check_domain_result">
                    <div class="check_domain_result_main">
                        <div class="title">
                            
                        </div>
                        <div class="main">
                            <ul class="list_check_result">
                                
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    </div><!-- End detail -->
    <script>
    $(document).ready(function() {
        var dt_scroll = $(window).height();
        $('.scroll_dt').slimScroll({
            height: dt_scroll,
            wheelStep: 2
        });
    });
    //Click vào các tab
    $('.list_check_tab_phobien').on('click',function(){
        $('.list_check_tab div').removeClass('active');
        $(this).addClass('active');
        $('.list_check').css({'display':'none'});
        $('.list_check input').attr('checked',false);
        $('.list_check_phobien').css({'display':'block'});
        $('.list_check_phobien input').trigger('click');
        
    });
    $('.list_check_tab_vietnam').on('click',function(){
        $('.list_check_tab div').removeClass('active');
        $(this).addClass('active');
        $('.list_check').css({'display':'none'});
        $('.list_check input').attr('checked',false);
        $('.list_check_vietnam').css({'display':'block'});
        $('.list_check_vietnam input').trigger('click');
        
    });
    $('.list_check_tab_quocte').on('click',function(){
        $('.list_check_tab div').removeClass('active');
        $(this).addClass('active');
        $('.list_check').css({'display':'none'});
        $('.list_check input').removeAttr('checked');
        $('.list_check_quocte').css({'display':'block'});
        $('.list_check_quocte input').trigger('click');
        
    });
    $('.list_check_tab_diagioi').on('click',function(){
        $('.list_check_tab div').removeClass('active');
        $(this).addClass('active');
        $('.list_check').css({'display':'none'});
        $('.list_check input').removeAttr('checked');
        $('.list_check_diagioi').css({'display':'block'});
        //$('.list_check_diagioi input').trigger('click');
        
    });
    //Click submit kiểm tra
    $('.domain_submit').on('click',function(){
        var domain_input = $('.domain_input').val();
        if(domain_input == '') {
            alert('Bạn chưa nhập tên miền cần kiểm tra');
            return false;
        } 
        //xu ly domain nhap vao
        //replate va trim
        domain_input = domain_input.replace(" ","");
        domain_input = domain_input.trim();
        //lay index cua dau cham neu co
        var dot = domain_input.indexOf(".");
        if(dot > 0) {
            domain_input = domain_input.substr(0,(dot));
        }
        var arr_check = new Array();
        var arr_dm = $('input[name="ext"]:checked');  
        arr_dm.each(function() {
            arr_check.push(this.value);
        });
        if(arr_check.length > 0) {
            var list_check_str = '';
            for(i in arr_check){
                list_check_str += '<li data-id="'+arr_check[i]+'" class="domain_loading"><p>'+domain_input+arr_check[i]+'</p></li>';
            }
            $('.check_domain_result_main .title').html('<h3>Kết quả kiểm tra tên miền</h3>');
            $('.list_check_result').html(list_check_str);
            $.each(arr_check, function(index, value) {
                var data = {name:'check_domain',check_val:domain_input,check_type:value};
                loadAjax(data,'json',{
                    success:function(res){
                        if(res.check == '1') {
                            $('.list_check_result').find('[data-id="'+value+'"]').addClass('domain_active');
                            //$('.list_check_result').append('true'+domain_input+'');
                        }else {
                            $('.list_check_result').find('[data-id="'+value+'"]').addClass('domain_registed');
                            $('.list_check_result').find('[data-id="'+value+'"]').find('p').append(' <a href="javascript:;" class="check_domain_whois_info" data-whois="'+domain_input+value+'"> (Whois)</a>');
                        }
                    }
                });
            });
            //Lam rỗng và thêm nút quay lại
            $('.check_domain_action').html('');
            $('.check_domain_result_main .main').append('<div class="check_domain_back"><a href="/kiem-tra-ten-mien.html">Quay lại</a></div>');
        }else {
            alert('Bạn chưa chọn 1 loại tên miền nào');
        }        
    });
    //Enter kiem tra
    $('.domain_input').on('keypress',function(event) {
    if(event.which == 13){
        var domain_input = $('.domain_input').val();
        if(domain_input == '') {
            alert('Bạn chưa nhập tên miền cần kiểm tra');
            return false;
        } 
        //xu ly domain nhap vao
        //replate va trim
        domain_input = domain_input.replace(" ","");
        domain_input = domain_input.trim();
        //lay index cua dau cham neu co
        var dot = domain_input.indexOf(".");
        if(dot > 0) {
            domain_input = domain_input.substr(0,(dot));
        }
        var arr_check = new Array();
        var arr_dm = $('input[name="ext"]:checked');  
        arr_dm.each(function() {
            arr_check.push(this.value);
        });
        if(arr_check.length > 0) {
            var list_check_str = '';
            for(i in arr_check){
                list_check_str += '<li data-id="'+arr_check[i]+'" class="domain_loading"><p>'+domain_input+arr_check[i]+'</p></li>';
            }
            $('.check_domain_result_main .title').html('<h3>Kết quả kiểm tra tên miền</h3>');
            $('.list_check_result').html(list_check_str);
            $.each(arr_check, function(index, value) {
                var data = {name:'check_domain',check_val:domain_input,check_type:value};
                loadAjax(data,'json',{
                    success:function(res){
                        if(res.check == '1') {
                            $('.list_check_result').find('[data-id="'+value+'"]').addClass('domain_active');
                            //$('.list_check_result').append('true'+domain_input+'');
                        }else {
                            $('.list_check_result').find('[data-id="'+value+'"]').addClass('domain_registed');
                            $('.list_check_result').find('[data-id="'+value+'"]').find('p').append(' <a href="javascript:;" class="check_domain_whois_info" data-whois="'+domain_input+value+'"> (Whois)</a>');
                        }
                    }
                });
            });
            //Lam rỗng và thêm nút quay lại
            $('.check_domain_action').html('');
            $('.check_domain_result_main .main').append('<div class="check_domain_back"><a href="/kiem-tra-ten-mien.html">Quay lại</a></div>');
        }else {
            alert('Bạn chưa chọn 1 loại tên miền nào');
        }
    }
    });
    //Click nut xem whois
    $('.list_check_result').on('click','.check_domain_whois_info',function(){
         var whois = $(this).attr('data-whois');
         var data = {name:'check_whois',whois:whois};
         loadAjax(data,'json',{
            success:function(res){
                $('.whois_display_content_main').html('<h2>Thông tin whois của domain <a href="http://'+whois+'" target="_blank">'+whois+'</a></h2>');
                $('.whois_display_content_main').append(res.whois);
            },
            beforeSend:function() {
                $('.whois_display_content').css({'display':'block'});
                $('.whois_display_wrap').css({'display':'block'});
                $('.whois_display_content_main').html('<div class="whois_display_content_main_load"></div>');
            }
        });
    });
    </script>
    <? include('../view/view_nav.php')?>
</div><!-- End wrapper -->
<div class="whois_display_content">
    <div class="whois_display_content_close">&Chi;</div>
    <div class="whois_display_content_main"></div>
</div>
<div class="whois_display_wrap"></div>
<script>
//Close popup xem whois
$('.whois_display_content_close').on('click',function(){
     $('.whois_display_content').css({'display':'none'});
     $('.whois_display_wrap').css({'display':'none'});
});
</script>
</body>
</html>